package bb.lanxing.calc.data;

public class IndoorbikePoint implements Cloneable, RecycleData {
    private double indoorbikespeed;
    private double indoorbiketotaldistance;
    private int indoorbikecadence;
    private int indoorbikepower;
    private int indoorbikeresistancelevel;
    private int indoorbikeenergy;
    private int indoorbikeheartrate;
    private int source = 2;

    public IndoorbikePoint copy(IndoorbikePoint reuse) {
        if (reuse == null) {
            reuse = new IndoorbikePoint();
        }
        reuse.indoorbiketotaldistance = this.indoorbiketotaldistance;
        reuse.indoorbikespeed = this.indoorbikespeed;
        reuse.indoorbikecadence = this.indoorbikecadence;
        reuse.indoorbikepower = this.indoorbikepower;
        reuse.indoorbikeresistancelevel = this.indoorbikeresistancelevel;
        reuse.indoorbikeenergy = this.indoorbikeenergy;
        reuse.indoorbikeheartrate = this.indoorbikeheartrate;
        reuse.source = this.source;
        return reuse;
    }

    public IndoorbikePoint clone() {
        try {
            return (IndoorbikePoint) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public void recycle() {
        this.indoorbiketotaldistance = 0;
        this.indoorbikespeed = 0;
        this.indoorbikecadence = 0;
        this.indoorbikepower = 0;
        this.indoorbikeresistancelevel = 0;
        this.indoorbikeenergy = 0;
        this.indoorbikeheartrate = 0;
        this.source = 2;
    }

    public double getIndoorbikeSpeed() {
        return this.indoorbikespeed;
    }

    public void setIndoorbikeSpeed(double indoorbikespeed) {
        this.indoorbikespeed = indoorbikespeed;
    }

    public double getIndoorbikeTotalDistance() {
        return this.indoorbiketotaldistance;
    }

    public void setIndoorbikeTotalDistance(double indoorbiketotaldistance) {
        this.indoorbiketotaldistance = indoorbiketotaldistance;
    }
    public int getIndoorbikeCadence() {
        return this.indoorbikecadence;
    }

    public void setIndoorbikeCadence(int indoorbikecadence) {
        this.indoorbikecadence = indoorbikecadence;
    }

    public int getIndoorbikePower() {
        return this.indoorbikepower;
    }

    public void setIndoorbikePower(int indoorbikepower) {
        this.indoorbikepower = indoorbikepower;
    }

    public int getIndoorbikeResistanceLevel() {
        return this.indoorbikeresistancelevel;
    }

    public void setIndoorbikeResistanceLevel(int indoorbikeresistancelevel) {
        this.indoorbikeresistancelevel = indoorbikeresistancelevel;
    }

    public int getIndoorbikeEnergy() {
        return this.indoorbikeenergy;
    }

    public void setIndoorbikeEnergy(int indoorbikeenergy) {
        this.indoorbikeenergy = indoorbikeenergy;
    }
    public int getIndoorbikeHeartRate() {
        return this.indoorbikeheartrate;
    }

    public void setIndoorbikeHeartRate(int indoorbikeheartrate) {
        this.indoorbikeheartrate = indoorbikeheartrate;
    }

    public int getSource() {
        return this.source;
    }

    public void setSource(int source) {
        this.source = source;
    }
}
